package com.albertzhe.demospringbootmybatisplus;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@SpringBootApplication
@MapperScan({"com.albertzhe.demospringbootmybatisplus.mapper"})
public class DemoSpringbootMybatisplusApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoSpringbootMybatisplusApplication.class, args);
	}

	@GetMapping("index")
	public String index(@RequestParam(value = "name", defaultValue = "World", required=false) String name) {
		String str = "Hello " + name;
		log.info(str);
		return str;
	}
}
